import timeit
import torch
import seaborn as sns
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

# x = torch.rand(2**11,2**11)
# x = x.to('cuda')
# timeit_cpu = timeit.timeit("x@x",globals = globals(),number=100)
# print(timeit_cpu)

def f(x):
    return torch.pow((x-2.0),2)

x_axis_vals = np.linspace(-7,9,100)
y_axis_vals = f(torch.tensor(x_axis_vals)).numpy()
sns.lineplot(x=x_axis_vals,y=y_axis_vals,label='xxx')

# sns.set(style="whitegrid")
#
# rs = np.random.RandomState(365)
# values = rs.randn(365, 4).cumsum(axis=0)
# dates = pd.date_range("1 1 2016", periods=365, freq="D")
# data = pd.DataFrame(values, dates, columns=["A", "B", "C", "D"])
# data = data.rolling(7).mean()
#
# sns.lineplot(data=data, palette="tab10", linewidth=2.5)
plt.show()